//
//  OrderedActivityCell.m
//  SDSY
//
//  Created by 蓝布鲁 on 2017/4/17.
//  Copyright © 2017年 蓝布鲁. All rights reserved.
//

#import "OrderedActivityCell.h"
#import "OrderedActivityModel.h"

@interface OrderedActivityCell ()

@property (nonatomic,retain)UILabel *gradeLabel;

@end

@implementation OrderedActivityCell

-(void)setupView {
    [super setupView];
    // 显示已经获得的分数
    self.gradeLabel = [[UILabel alloc] init];
    self.gradeLabel.font = [UIFont systemFontOfSize:12];
    self.gradeLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:self.gradeLabel];
    
    // 布局
    self.gradeLabel.sd_layout.topEqualToView(self.locationView).rightSpaceToView(self.contentView, 10).heightIs(15);
    [self.gradeLabel setSingleLineAutoResizeWithMaxWidth:200];
}


-(void)setModel:(ActivityModel *)model {
    [super setModel:model];
    // 显示已经获得的分数
    OrderedActivityModel *orderedModel = (OrderedActivityModel *)model;
    if(orderedModel.grade == 1){
        self.gradeLabel.text = @"优秀";
    } else if(orderedModel.grade == 2){
        self.gradeLabel.text = @"良好";
    } else{
        self.gradeLabel.text = @"不及格";
    }

    
}
@end
